all: support for Go 1.27#5477
Conversation
|
Size difference with the dev branch: Binary size differencedrivers/sizes-dev.txt has more commands than drivers/sizes-pr.txt
tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/adafruit4650
flash ram
before after diff before after diff
|
|
Added another commit with support for the new |
|
It got further. I think perhaps the new set of errors might have to do with the SSA changes for generics we were just discussing @jakebailey @aykevl |
|
Added another commit that updates |
|
For Windows, seems like you need the I think |
|
I think I actually have all of the other failures figured out, but, not sure what to do with the fixes. One or two of them I can send to |
cfcf9cd to
db17b48
Compare
|
@jakebailey I just overwrote your commits that you had already added to this branch by force puching without having pulled your changes to my local branch first. Sorry about that, my bad :( Can you help get them back in please? |
|
I don't have the ability to for a few days but you can download these and git apply them |
|
@jakebailey thanks! Just ammended this PR with those 2 commits... |
|
Looks like the test failures so far are perhaps related to |
|
Yeah, I couldn't figure those out as they did not reproduce locally |
|
Actually it seems like it was |
|
That last commit reminds me of #5508 |
|
#5508 was merged, then I removed my commit from this branch and rebased in the latest |
|
Looks like I needed a version of that commit after all to handle the float32/float64 difference. |
|
All tests passing (except for a couple that were skipped). |
There was a problem hiding this comment.
Pull request overview
Updates TinyGo’s toolchain/CI integration and compiler behavior to work with Go 1.27-rc2, including new Go 1.27 language/tooling patterns and platform/test adjustments.
Changes:
- Bump supported Go minor range (min 1.25, max 1.27) and update CI/Docker to Go 1.27.0-rc.2.
- Fix generic instantiation name collisions caused by function-local type aliases (Go 1.27
internal/strconvpattern) and add coverage intestdata/localtypes. - Add support for
//go:linknamestd, adjust Windows runtime library/builtins selection, and tweak WASI fast stdlib test package selection.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/localtypes.txt | Adds expected outputs for new alias-size regression checks. |
| testdata/localtypes.go | Adds a regression reproducer for Go 1.27’s function-local type alias generic pattern. |
| src/runtime/os_darwin_go126.go | Adjusts build tags to include Go 1.27. |
| main_test.go | Adds Go-minor-based test skipping for a size-constrained target on Go 1.27+. |
| go.mod | Updates Go language version directive and bumps x/* dependencies. |
| go.sum | Updates checksums for the bumped x/* dependencies. |
| GNUmakefile | Disables problematic stdlib tests and refines WASI “fast” package set. |
| Dockerfile | Updates build container images to Go 1.27rc2. |
| compiler/testdata/pragma.ll | Extends pragma IR test fixture for linknamestd. |
| compiler/testdata/pragma.go | Adds a test case using //go:linknamestd. |
| compiler/symbol.go | Disambiguates local type-alias instantiations and recognizes //go:linknamestd. |
| compileopts/target.go | Ensures Windows/amd64 and Windows/arm64 select compiler-rt. |
| builder/sizes_test.go | Updates expected binary size baselines. |
| builder/config.go | Updates supported Go minor range to include Go 1.27 and raise minimum to 1.25. |
| builder/builtins.go | Adds Windows chkstk builtins for amd64/arm64 and refines Windows triple detection. |
| .github/workflows/windows.yml | Updates CI to Go 1.27.0-rc.2 and refreshes caches/wasmtime. |
| .github/workflows/linux.yml | Updates CI/container images to Go 1.27rc2 and refreshes caches/wasmtime. |
| .github/workflows/compat.yml | Updates minimum-compat Go version to 1.25. |
| .github/workflows/build-macos.yml | Updates CI to Go 1.27.0-rc.2 and refreshes cache keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: deadprogram <ron@hybridgroup.com>
Signed-off-by: deadprogram <ron@hybridgroup.com>
Go 1.27 adds generic methods (golang/go#77273). golang.org/x/tools go/ssa v0.42.0 does not instantiate them: objectMethod only applies receiverTypeArgs and ignores method-level type parameters, so a call such as (*math/rand/v2.Rand).N resolves to the abstract generic method and its body reaches createConst with a type-parameter-typed zero constant, triggering "panic: expected nil interface constant". Upgrade golang.org/x/tools to v0.47.0, whose go/ssa returns nil from MethodValue for generic methods and instantiates method-level type parameters. No compiler changes are required. Since x/tools v0.47.0 requires Go 1.25, raise the minimum supported Go version from 1.24 to 1.25. Signed-off-by: deadprogram <ron@hybridgroup.com>
Go 1.27 packages can emit stack probes on Windows amd64 and arm64. Link the compiler-rt stack probe builtins and use compiler-rt for those targets so these packages build.
Go 1.27 jsonv2 pushes testdata/json.go beyond the LM3S6965 flash budget. Keep coverage on larger emulated targets while skipping only the too-small Cortex-M QEMU configuration.
Signed-off-by: deadprogram <ron@hybridgroup.com>
Signed-off-by: deadprogram <ron@hybridgroup.com>
Signed-off-by: deadprogram <ron@hybridgroup.com>
…ases x/tools go/ssa names instantiations using the type argument's String(). Function-local aliases like `type F = float64` therefore collide when two callers use distinct aliases named F (Go 1.27's internal/strconv.ftoa32 and ftoa64 do exactly this). Extend localTypeArgsSuffix to detect local aliases and include their declaration position, so the float32 and float64 instantiations get distinct LLVM symbols. Fixes wrong float formatting in strconv/math on Go 1.27, and adds a regression test to testdata/localtypes.go. Signed-off-by: deadprogram <ron@hybridgroup.com>
This PR is to add support for Go 1.27
Current passes tests on 1.27-rc2